package com.design.proxy.file;

// 文件代理类
class FileProxy implements File {
    private RealFile realFile;
    private String filename;

    public FileProxy(String filename) {
        this.filename = filename;
    }

    @Override
    public void read() {
        if (realFile == null) {
            realFile = new RealFile(filename);
        }
        realFile.read();
    }
}
